<?php
/*
 * emarket - a website to create your own online-shop.  
 * Copyright (C) 2009  Frédéric Delorme
 *
 * This file is part of emarket.
 *
 * emarket is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * emarket is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with emarket.  If not, see <http://www.gnu.org/licenses/>.
 *
 * To contact me: frederic.delorme@gmail.com
 * to see some information on te project : http://code.google.col/p/os-emarket/
 *
 */

/**
 * Pagination manager class to maintain navigation into resultset of any request
 * on data persistence system.
 */class Paginator{
	private $_entity;
	private $_index;
	private $_pagesize=20;

	public function Paginator($entity){
		$this->_entity = $entity;
	}

	public function setPage($pageno="1"){
		$this->_index= ($pageno-1)*$this->_pagesize;
	}
	public function getLimit(){
		$limit = array('offset'=>$this->_index,'max'=>$this->_pagesize);
		return $limit;

	}
	
}
?>
